//
//  LoverCallView.h
//  Molian
//
//  Created by 小蚕科技 on 15/6/8.
//  Copyright (c) 2015年 xiaocan. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
#import <CoreTelephony/CTCallCenter.h>
//#import "EMSDKFull.h"
#import "EaseMob.h"
#import "MLUser.h"
#import "MLLovers.h"
#import "MLCallRecord.h"
#import "UIButtonImageWithLabel.h"
#import "HJActionSheet.h"

@protocol LoverCallViewDelegate <NSObject>

@optional
//恋爱呼叫
- (void)loveCallOut;
//push到举报并上传截图页面
- (void)pushReportVCUser:(MLUser *)user;
@end

static CTCallCenter *g_callCenter;
@interface LoverCallView : UIView<EMCallManagerDelegate, AVCaptureVideoDataOutputSampleBufferDelegate,HJActionSheetDelegate>
{
    
    //筛选相关视图
    UIView *matchingView;
    //电话等待图片
    UIImageView *matchingImageView;
    
    //通话接通后要出现的画面
    UIView *showView;
    //倒计时
    UIView *countView;
    //位置和想你叫ta等
    UIView *dataView;
    //位置
    UILabel *userLocation;
    //星座
    UILabel *constellation;
    //类型
    UILabel *typeLabel;
    //想你叫ta
    UILabel *microphoneLabel;
    //想你叫ta
    UILabel *userMicrophone;
    //设置接通后共有的View
    UIView *connectMutualView;
    //换人
    UIButtonImageWithLabel *substitutionBt;
    //喜欢
    UIButtonImageWithLabel *likeBt;
    //免提
    UIButtonImageWithLabel *handsBt;
    //相互喜欢说明
    UIButton *togetherLove;
    //相互喜欢后显示头像
    UIView *headerView;
    NSTimer *_timeTimer;
    //开始随机后,30秒后没有拨通,则弹框提示
    NSTimer *filtrateTimer;
    //时间计数
    NSInteger filtrate;
    UIView *filtrateTimerView;
    
    //打电话的计时器
    NSTimer *callTimer;
    //通话时长双方都喜欢后的时间
    NSTimer *likeLaterTimer;
    //时间
    BOOL  like;
    NSInteger likeLaterLength;
    UILabel * likeLaterLabel;
    UILabel *_timeLabel;
    UILabel *_nameLabel;
    UIImageView *_headerImageView;
    
    UIButton *_speakerOutButton;
    
    BOOL _isIncoming;
    int _timeLength;
    EMCallSession *_callSession;
    UInt8 *_imageDataBuffer;
    
        NSString * _audioCategory;
        NSInteger m;
        NSInteger s;
        NSInteger cost;
        
        MLUser *_chatUser;
}

@property (strong, nonatomic) NSString *chatter;
@property (nonatomic, strong) MLLovers *lovers;
@property (nonatomic,assign) id<LoverCallViewDelegate>delegate;
- (void)session:(EMCallSession *)session isIncoming:(BOOL)isIncoming ChatUser:(MLUser*)chatUser;
//开始随机电话
- (void)beginLoversCall;
//开始计时
- (void)filtrateTimer;
//+ (BOOL)canVideo;
@end
